package com.wyp.controller;

import com.wyp.common.Result;
import com.wyp.entity.User;
import com.wyp.rabbitmq.MQSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: Oliver
 */
@Controller
@RequestMapping("/mq")
public class MQContrller {
    @Autowired
    MQSender mqSender;

    @RequestMapping("/sender")
    @ResponseBody
    public Result info() {
        mqSender.send("hello mq");
        return Result.success(true);
    }

    @RequestMapping("/senderTopic")
    @ResponseBody
    public Result topic() {
        mqSender.sendTopic("hello mq topic");
        return Result.success(true);
    }


    @RequestMapping("/senderFan")
    @ResponseBody
    public Result fan() {
        mqSender.sendTopic("hello mq topic");
        return Result.success(true);
    }
}
